# !/usr/bin/python3
# -*- coding: utf-8 -*-

"""
租户信息表模型类
----------------------------------------------------
@Project :   xinhou-openai-framework
@File    :   Tenant.py
@Contact :   sp_hrz@qq.com

@Modify Time      @Author    @Version    @Desciption
------------      -------    --------    -----------
2023/04/16 22:04  peng.shen   v1.0.0     None
"""

from sqlalchemy import ForeignKey
from sqlalchemy import func

from sqlalchemy import Column, Integer, String, Text, Numeric, TIMESTAMP
from xinhou_openai_framework.core.orm.entity.BaseEntity import BaseEntity


class Tenant(BaseEntity):
    # 数据表名&字段
    __tablename__ = 't_tenant'

    tenant_code = Column(String(32), comment="租户编码")
    tenant_name = Column(String(128), comment="租户名称")
    api_key = Column(String(128), comment="租户ApiKey")
    num_tokens = Column(Integer, default='0', comment="api调用计算token总数")
    remark = Column(String(500), comment="备注")
    status = Column(Integer, default='1', comment="状态:1=正常,2=停用")